import java.util.*;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: WHY
 * Date: 2022-12-03
 * Time: 11:38
 */
public class Test{
    public static void main(String[] args) {
        List<Integer> list=new List<Integer>() {
            @Override
            public int size() {
                return 0;
            }

            @Override
            public boolean isEmpty() {
                return false;
            }

            @Override
            public boolean contains(Object o) {
                return false;
            }

            @Override
            public Iterator<Integer> iterator() {
                return null;
            }

            @Override
            public Object[] toArray() {
                return new Object[0];
            }

            @Override
            public <T> T[] toArray(T[] a) {
                return null;
            }

            @Override
            public boolean add(Integer integer) {
                return false;
            }

            @Override
            public boolean remove(Object o) {
                return false;
            }

            @Override
            public boolean containsAll(Collection<?> c) {
                return false;
            }

            @Override
            public boolean addAll(Collection<? extends Integer> c) {
                return false;
            }

            @Override
            public boolean addAll(int index, Collection<? extends Integer> c) {
                return false;
            }

            @Override
            public boolean removeAll(Collection<?> c) {
                return false;
            }

            @Override
            public boolean retainAll(Collection<?> c) {
                return false;
            }

            @Override
            public void clear() {

            }

            @Override
            public Integer get(int index) {
                return null;
            }

            @Override
            public Integer set(int index, Integer element) {
                return null;
            }

            @Override
            public void add(int index, Integer element) {

            }

            @Override
            public Integer remove(int index) {
                return null;
            }

            @Override
            public int indexOf(Object o) {
                return 0;
            }

            @Override
            public int lastIndexOf(Object o) {
                return 0;
            }

            @Override
            public ListIterator<Integer> listIterator() {
                return null;
            }

            @Override
            public ListIterator<Integer> listIterator(int index) {
                return null;
            }

            @Override
            public List<Integer> subList(int fromIndex, int toIndex) {
                return null;
            }
        }
    }
    public static void main3(String[] args) {
        List<Integer> list=new ArrayList<>();
        list.add(1);
        list.add(2);
        list.add(3);
        list.add(4);
       /* for(int i=0;i<list.size();i++){
            System.out.println(list.get(i)+" ");
        }
        System.out.println("=====");

        for ( Integer x:list) {
            System.out.println(x);
        }*/


        //使用迭代器
        ListIterator<Integer>  iterator=list.listIterator();

        while (iterator.hasNext()) {
            System.out.print(iterator.next()+" ");
        }

    }
    public static void main2(String[] args) {
    List<Integer> list=new ArrayList<>();
        list.add(1);
        list.add(2);
        list.add(3);
        System.out.println(list);
        ArrayList<Number> arrayList1=new ArrayList<>(list);
        System.out.println(arrayList1);
        arrayList1.add(10);
        arrayList1.add(25);
        System.out.println(arrayList1);


    }
    public static void main1(String[] args) {
        List<Integer> list=new java.util.ArrayList<>();//new一个ArrayList类的对象，
        list.add(1);
        list.add(2);
        list.add(3);
        list.add(4);
        list.add(5);
        System.out.println(list);
        list.size();
        System.out.println(list.size());
        list.add(6);
        System.out.println(list);
        list.remove(2);//根据下标进行删除
        System.out.println(list);
        list.remove(new Integer(5));//根据对象中某个具体的数进行删除
        System.out.println(list);
        list.get(3);
        System.out.println(list);
        list.set(1,10);
        System.out.println(list);
         List<Integer>  ret=  list.subList(0,2);
        System.out.println(ret);

    }



}
